const express = require('express');
const router = require('./routers');
const body = require('body-parser')

const server = express();
server.use('/static',express.static('./static'));
server.use('/public',express.static('./public'));
server.use(body({ extended: false })) // 告诉服务 解析前端传过来的 查询字符串
server.use(body.json()) // 解析前端传过来的json 


server.use('/api',router)
server.listen(8081,()=>{
    console.log('服务启动成功8081');
});